package cn.zjyj.module.zjyj.dal.mysql.riskidentifytargetcontent;

import cn.zjyj.framework.common.common.pojo.PageResult;
import cn.zjyj.framework.datasource.mybatis.core.query.LambdaQueryWrapperX;
import cn.zjyj.framework.datasource.mybatis.core.mapper.BaseMapperX;
import cn.zjyj.module.zjyj.dal.dataobject.riskidentifytargetcontent.RiskIdentifyTargetContentDO;
import org.apache.ibatis.annotations.Mapper;
import cn.zjyj.module.zjyj.controller.admin.riskidentifytargetcontent.vo.*;

/**
 * 风险辨识内容 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RiskIdentifyTargetContentMapper extends BaseMapperX<RiskIdentifyTargetContentDO> {

    default PageResult<RiskIdentifyTargetContentDO> selectPage(RiskIdentifyTargetContentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RiskIdentifyTargetContentDO>()
                .betweenIfPresent(RiskIdentifyTargetContentDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(RiskIdentifyTargetContentDO::getIdentifyId, reqVO.getIdentifyId())
                .eqIfPresent(RiskIdentifyTargetContentDO::getIdentifyInstanceId, reqVO.getIdentifyInstanceId())
                .eqIfPresent(RiskIdentifyTargetContentDO::getRiskTargetId, reqVO.getRiskTargetId())
                .eqIfPresent(RiskIdentifyTargetContentDO::getIdentifyContent, reqVO.getIdentifyContent())
                .eqIfPresent(RiskIdentifyTargetContentDO::getIdentifyContentCode, reqVO.getIdentifyContentCode())
                .eqIfPresent(RiskIdentifyTargetContentDO::getHazard, reqVO.getHazard())
                .eqIfPresent(RiskIdentifyTargetContentDO::getProjectSolution, reqVO.getProjectSolution())
                .eqIfPresent(RiskIdentifyTargetContentDO::getManagerSolution, reqVO.getManagerSolution())
                .eqIfPresent(RiskIdentifyTargetContentDO::getSelfSolution, reqVO.getSelfSolution())
                .eqIfPresent(RiskIdentifyTargetContentDO::getTrainEduSolution, reqVO.getTrainEduSolution())
                .eqIfPresent(RiskIdentifyTargetContentDO::getBadSolution, reqVO.getBadSolution())
                .orderByDesc(RiskIdentifyTargetContentDO::getId));
    }

}